package com.doone.telmarket.action.admin;

import java.io.IOException;

import org.apache.log4j.Logger;
import org.apache.struts2.convention.annotation.Action;
import org.springframework.beans.factory.annotation.Autowired;

import com.doone.telmarket.service.ServiceProductOperation;
import com.doone.telmarket.vo.HotBusiVo;


/**
 * @package
 * @author 甘雨波
 * @description PRODUCT相关操作ACTION
 * @date 2009-11-5
 */
public class ProductAction extends BaseActionSupport {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	Logger log = Logger.getLogger(ProductAction.class);
	
	@Autowired
	private ServiceProductOperation remoteServiceProductOperation;
	
	private String type;
	
	private String serviceCode;
	
	private String productId;
	
	private String orderId;
	
	@Action("deleteHeadHotBusi")
	public void deleteHeadHotBusi(){
		try {
			remoteServiceProductOperation.deleteHotBusi(type);
			responseWrite("删除数据成功");
		} catch (Exception e) {
			e.printStackTrace();
			try {
				responseWrite("删除数据失败");
			} catch (IOException e1) {
				e1.printStackTrace();
			}
		}
	}
	
	@Action("insertHeadHotBusi")
	public void insertHeadHotBusi(){
		try {
			HotBusiVo view = new HotBusiVo();
			view.setServiceCode(Integer.parseInt(serviceCode));
			view.setType(type);
			view.setOrderId(orderId);
			remoteServiceProductOperation.insertHotBusi(view);
			responseWrite("保存数据成功");
		} catch (Exception e) {
			e.printStackTrace();
			try {
				responseWrite("保存数据失败");
			} catch (IOException e1) {
				e1.printStackTrace();
			}
		}
	}
	


	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getServiceCode() {
		return serviceCode;
	}

	public void setServiceCode(String serviceCode) {
		this.serviceCode = serviceCode;
	}

	public String getProductId() {
		return productId;
	}

	public void setProductId(String productId) {
		this.productId = productId;
	}

	public String getOrderId() {
		return orderId;
	}

	public void setOrderId(String orderId) {
		this.orderId = orderId;
	}

	
	

}
